#ifndef KEPINYINSIMPLE_H
#define KEPINYINSIMPLE_H

#include "kepinyin_global.h"

#include <QString>
#include <QtTypes>

typedef char CHAR_KePinyin;

#define LenKePinyinWord 8
#define TotalKePinyinWord 20902

#define TotalDistinctName 21

// N&0xfffffff8  === (N/8)*8
#define SizeBuff_Pinyin(N) ((7+6*N)&0xfffffff8)

#define Pinyin_separator_NULL   0

#define Pinyin_separator_Default   0x0020

struct DistinctNameTablePy
{
    ushort name[4];
    char pinyin[16];
};






class KePinyinSimple
{
public:
    KePinyinSimple();
    KePinyinSimple(const KePinyinSimple &single) = delete;
    const KePinyinSimple &operator=(const KePinyinSimple &single) = delete;
     ~KePinyinSimple();
public:
    int getPinyinAsii(const QString &txt,CHAR_KePinyin separator,CHAR_KePinyin *buf,int *ptrNLatin1);
    int getPinyinLatin(const QString &txt,CHAR_KePinyin split,ushort *bufChar);


private:
    CHAR_KePinyin (*kePinyinData)[LenKePinyinWord];
    DistinctNameTablePy *keDistinctName;

};


KePinyinSimple *KePinyinGetInstance();

KEPINYIN_EXPORT int KeGetPinyinAsii(const QString &txt,CHAR_KePinyin separator,char *buf,int *countLatin1);
KEPINYIN_EXPORT int KeGetPinyinLatin(const QString &txt,CHAR_KePinyin separator,ushort *bufChar);

QString KEPINYIN_EXPORT KeGetPinyinWrap(const QString &txt);

#endif // KEPINYINSIMPLE_H
